package com.lzl.service;

import com.lzl.dao.PetDao;
import com.lzl.dao.PetDaoMySQLImpl;
import com.lzl.dao.PetDaoOracleImpl;
import com.lzl.entity.Pet;
import com.lzl.factory.PetDaoFactory;

import javax.annotation.Resource;

public class PetServiceImpl implements PetService{
//    PetDao petDao = PetDaoFactory.getInstance(PetDaoFactory.defaultBeanName);
//    @Autowired
    @Resource(type = PetDaoOracleImpl.class)
    private PetDao petDao;

    public PetDao getPetDao() {
        return petDao;
    }

    public void setPetDao(PetDao petDao) {
        this.petDao = petDao;
    }

    @Override
    public boolean save(Pet pet) {
      return petDao.insert(pet)>0;
    }
}
